package cn.ms.doctor.Entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 
 * @TableName doctor_order
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Order implements Serializable {
    /**
     * 订单id
     */
    private Integer orderId;

    /**
     * 医生id
     */
    private Integer userId;

    /**
     * 患者ID
     */
    private Integer patientId;

    /**
     * 诊断id
     */
    private Integer prescriptionId;

    /**
     * 订单生成时间
     */
    private Date orderCreatetime;

    /**
     * 支付时间
     */
    private Date orderPaytime;

    /**
     * 结束时间
     */
    private Date orderEndtime;

    /**
     * 订单价格
     */
    private BigDecimal orderPrice;

    /**
     * 订单状态 0未支付 1待发放药物 2结单
     */
    private Integer orderState;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Order other = (Order) that;
        return (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getPatientId() == null ? other.getPatientId() == null : this.getPatientId().equals(other.getPatientId()))
            && (this.getPrescriptionId() == null ? other.getPrescriptionId() == null : this.getPrescriptionId().equals(other.getPrescriptionId()))
            && (this.getOrderCreatetime() == null ? other.getOrderCreatetime() == null : this.getOrderCreatetime().equals(other.getOrderCreatetime()))
            && (this.getOrderPaytime() == null ? other.getOrderPaytime() == null : this.getOrderPaytime().equals(other.getOrderPaytime()))
            && (this.getOrderEndtime() == null ? other.getOrderEndtime() == null : this.getOrderEndtime().equals(other.getOrderEndtime()))
            && (this.getOrderPrice() == null ? other.getOrderPrice() == null : this.getOrderPrice().equals(other.getOrderPrice()))
            && (this.getOrderState() == null ? other.getOrderState() == null : this.getOrderState().equals(other.getOrderState()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getPatientId() == null) ? 0 : getPatientId().hashCode());
        result = prime * result + ((getPrescriptionId() == null) ? 0 : getPrescriptionId().hashCode());
        result = prime * result + ((getOrderCreatetime() == null) ? 0 : getOrderCreatetime().hashCode());
        result = prime * result + ((getOrderPaytime() == null) ? 0 : getOrderPaytime().hashCode());
        result = prime * result + ((getOrderEndtime() == null) ? 0 : getOrderEndtime().hashCode());
        result = prime * result + ((getOrderPrice() == null) ? 0 : getOrderPrice().hashCode());
        result = prime * result + ((getOrderState() == null) ? 0 : getOrderState().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", orderId=").append(orderId);
        sb.append(", userId=").append(userId);
        sb.append(", patientId=").append(patientId);
        sb.append(", prescriptionId=").append(prescriptionId);
        sb.append(", orderCreatetime=").append(orderCreatetime);
        sb.append(", orderPaytime=").append(orderPaytime);
        sb.append(", orderEndtime=").append(orderEndtime);
        sb.append(", orderPrice=").append(orderPrice);
        sb.append(", orderState=").append(orderState);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}